
interface cs{
    arr:number[]
    readonly [propName:string]:any
}
interface SearchFunc {
    (source: string, subString: string): string;
}
let mySearch: SearchFunc;
mySearch = function(source: string, subString: string) {
    if(source.indexOf(subString) !== -1){
        console.log('ok');
        return 'ok'
    }else{
        console.log('no');
        return 'np'
    }
}
let hexLiteral: cs = {arr:[1, 1, 2, 3, 5],value:10};
enum goto {'a'=4,'b'=2,'c'=3,'d'=4}
console.log(goto['a']===4,'a');
console.log(goto['b'],'b');
console.log(goto['d'] === 4,'d');
class superW{
    public readonly name:string;
    public constructor(name:string){
        this.name = name
    }
    public doing(){
        console.log('doing something '+this.name);
    }
}

let wangding = new superW('wangding')
wangding.doing()
wangding.name = 'wangfanfan' //error
wangding.doing()
console.log(wangding,'name');

export{
    hexLiteral,
    mySearch
}